home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-07 | 1.3 KB | 55 lines | [TEXT/DWat] |
- % Asymptote Demo #5
-
- % This script shows how to read data from rows of a data file
- % and plot a histogram
- datafile HST STARS
- fontname Times
- pensize .5
-
- % Choose which columns to read
- datacolumns 4 20
- % Then read them into x and y from rows 1 and 2
- readrow x 1
- readrow y 2
-
- % Close the datafile, we're done with it
- close \f
-
- graphlimits % Find the graph limits
- graphlimits xright xleft ybottom ytop % Then plot x backwards
- graphunits in
- graphframe 2 7 2 5
- fullscreen yes
-
- % Choose the fill pattern to fill under the histogram
- fillpat gray
- plothistogram 0.0 % Use 0.0 to for the baseline
-
- % Specify our own tick mark spacing in units we like
- graphticks .5 1 2e5 1e6
- ticksize 9 % Use 9 point ticks
-
- % Make the pen bigger and draw just the frame with no ticks or labels
- % This puts a thick border around the graph
- pensize 2
- drawframe inside inside noticks nolabels nolabels nolabels nolabels
-
- pensize 0.25
- % Draw the basic frame with ticks and labels
- notation general
- drawframe
-
- scale 1.5
- drawtitle HST Guide Star Catalog
- % Use the macro (defined in the macros file) to move to the top right
- TR
- rpn <y sum >y
- digits 1
- drawlabel belowleft \y(1) Stars
-
- % Make the x and y labels a little smaller than the title
- scale 1
- drawxlabel Visual Magnitude
- drawylabel Number of Stars
-
-